<?php
class Timer extends Object
{
	public $start;

	public function Timer()
	{
		$this->Start();
	}

	public function Start()
	{
		$this->start = microtime(true);
	}

	public function Stop()
	{
		return self::StopTimer($this->start);
	}

	// return time duration in ms
	public static function StopTimer($start = null)
	{
		return round((microtime(true) - $start)*1000);
	}
}

?>
